<%--
  Created by IntelliJ IDEA.
  User: HP
  Date: 2023/10/6
  Time: 9:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>request请求作用域</title>
</head>
<body>
    <%
        // request作用域：代表在同一个请求有效！
        request.setAttribute("book","《西游记》");
        // 转发保证是同一个请求
        request.getRequestDispatcher("/listbooks.jsp").forward(request,response);
        // 重定向：两次请求，所以，到达/listbooks.jsp页面取不到值！
        // response.sendRedirect("/listbooks.jsp");
    %>
</body>
</html>
